<?php /* Smarty version 2.6.18, created on 2010-03-10 17:14:23
         compiled from stafflist.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'stafflist.tpl', 73, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="editAddress" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<div id="editContact" style="background-color:#fff;width:500px;z-index: 1002;display:none;position: absolute;">
</div>
<script>
	var da = new ekimo_drag_region("content","editAddress");
	var dc = new ekimo_drag_region("content","editContact");
</script>
<div id="main_content">
    	<h1>Staff Maintenance</h1>
        
			<div class="blue">
        	    <form action="" id="filterForm" >
        	        <table style="width: 100%">
        				<tr>
        					<td><label for="filter">Staff No.:</label></td>
        					<td><select name="user[identification_no]" onchange="doajaxAction('/account/orgStaffs/reload/1',1,'result',document.getElementById('filterForm'))">
        						<option value="">All Staff</option>
        						<?php $_from = $this->_tpl_vars['ids']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['id']):
?>
        							<option value="<?php echo $this->_tpl_vars['id']['identification_no']; ?>
"><?php echo $this->_tpl_vars['id']['identification_no']; ?>
</option>
        						<?php endforeach; endif; unset($_from); ?>
        					</td>
        				</tr>
        				<tr>
        					<td><label for="filter">Status:</label></td>
        					<td><select name="user[status]" onchange="doajaxAction('/account/orgStaffs/reload/1',1,'result',document.getElementById('filterForm'))">
        						<option value="0">Any Status</option>
        						<option value="1">Active Only</option>
        						<option value="2">Inactive Only</option>
        					</td>
        				</tr>
        				<tr>
        					<td><label for="filter">Job Description:</label></td>
        					<td><select name="user[position]" onchange="doajaxAction('/account/orgStaffs/reload/1',1,'result',document.getElementById('filterForm'))">
        						<option value="">All Positions</option>
        						<?php $_from = $this->_tpl_vars['positions']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['position']):
?>
        							<option value="<?php echo $this->_tpl_vars['position']['position']; ?>
"><?php echo $this->_tpl_vars['position']['position']; ?>
</option>
        						<?php endforeach; endif; unset($_from); ?>
        					</td>
        				</tr>
        				<tr>
        					<td style="width: 100px"><label for="filter">Search Name:</label></td>
        					<td nowrap="1"><input name="user[search_name]" type="text" size="20" onchange="doajaxAction('/account/orgStaffs/reload/1',1,'result',document.getElementById('filterForm'))" /></td>
        					<td style="width: 100px; text-align: right"><input type="button" value="New Staff" onclick="editStaff(0);" />
    						</td>	    									
        				</tr>
        	        </table>
        	    </form>
        	</div>
       
            <div id="result">
				<div>
					<table border="0" width="100%">
					<tr><td colspan="9"><hr></td></tr>
					<tr>
					<?php if ($this->_tpl_vars['staffs'][0]['name'] <> ''): ?>
						<td align="center" style="padding-left: 5pt; padding-right: 5pt">Edit</td>
					<?php endif; ?>
						<td align="right">Photo</td>
						<td align="right">Staff No.</td>
						<td>Staff Name</td>
						<td>Job Description</td>
						<td align="right">Date Hired</td>
						<td align="right">Date Resigned</td>
						<td>Remarks</td>
						<?php if ($this->_tpl_vars['staffs'][0]['name'] <> ''): ?>
							<td align="center" style="padding-left: 5pt; padding-right: 5pt">Other Info</td>
						<?php endif; ?>
					</tr>
					<tr><td colspan="9"><hr></td></tr>
					<?php $_from = $this->_tpl_vars['staffs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['staff']):
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
						<?php if ($this->_tpl_vars['staff']['name'] <> ''): ?>
							<td align="center">
							<a href="javascript:void(0);" onclick="editStaff(<?php echo $this->_tpl_vars['staff']['staff_id']; ?>
);">Edit</a>
						</td>
						<?php endif; ?>
						<td><img src="<?php echo $this->_tpl_vars['staff']['link']; ?>
" /></td>
						<td align="right"><?php echo $this->_tpl_vars['staff']['identification_no']; ?>
</td>
						<td><?php echo $this->_tpl_vars['staff']['name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['staff']['position']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['staff']['date_hired']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['staff']['date_resigned']; ?>
</td>
						<td><?php echo $this->_tpl_vars['staff']['remarks']; ?>
</td>
						<?php if ($this->_tpl_vars['staff']['name'] <> ''): ?>
							<td align="center" nowrap>
								<a href="javascript:void(0);" onclick="editAddress('<?php echo $this->_tpl_vars['staff']['address_id_value']; ?>
');">Address</a>&nbsp;&nbsp;
								<a href="javascript:void(0);" onclick="editContact('<?php echo $this->_tpl_vars['staff']['contact_id_value']; ?>
');">Contact</a>&nbsp;&nbsp;
								<!-- <a href="javascript:void(0);" onclick="openWindow('/account/getStaffTraining/staffId/<?php echo $this->_tpl_vars['staff']['staff_id']; ?>
','StaffAddress',500,300,'scrollbars=yes');">Trainings</a>										 -->
							</td>
						<?php endif; ?>
					</tr>
					<?php endforeach; endif; unset($_from); ?>
					</table>
				</div>
            </div><!-- results -->
            
</div>
<script language="javascript">
	<?php echo '
		function editStaff(key){
			doajaxAction("/account/editStaff/staffId/"+key,0,"main_content");
		}
		function editAddress(addressId){
			doajaxAction("/account/getStaffAddress/addressId/"+addressId,0,\'editAddress\');
			popup("editAddress");
		}
		function editContact(contactId){
			doajaxAction("/account/getStaffContact/contactId/"+contactId,0,\'editContact\');
			popup("editContact");
		}
	'; ?>

</script>